package com.doucat.support.model.inter;

import java.util.List;

/**
 * -----------------------------------------------------------------
 * Copyright (C) 2014-2016, by your company, All rights reserved.
 * -----------------------------------------------------------------
 * File: BaseCallback.java
 * Author: wfy
 * Version: V100R001C01
 * Create: 2020/6/3 10:37
 * Changes (from 2020/6/3)
 * -----------------------------------------------------------------
 * 2020/6/3 : Create BaseCallback.java (wfy);
 * -----------------------------------------------------------------
 * 纯正的数据请求接口
 * 只包含了数据请求的生命周期
 */
public interface InterfaceView<T> {
    //请求开始 展示loading
    void onStartRequest();
    //okhttp响应 结束loading
    void onResponse();
    void onFailure(String str);//http的错误

    /**
     * 标准数据格式的回调
     * public int code;
     * public String msg;
     * public List<T> data;
     */
    //业务
    void onSuccess(String str);//http、json 正确，业务逻辑返回的错误
    void onFail(String str);//http、json 正确，业务逻辑返回的错误
    //数据
    void onData(List<T> data);
}
